/*
** my_str_islower.c for my_str_islower in /home/nadali_t//local/piscine/Jour_06/ex_12
** 
** Made by thomas nadalie
** Login   <nadali_t@epitech.net>
** 
** Started on  Mon Oct  8 16:17:35 2012 thomas nadalie
** Last update Mon Nov 19 16:46:09 2012 thomas nadalie
*/

#include	"my.h"

int		my_str_islower(char *str)
{
  int		i;
  int		lower;
  int		other;

  i = 0;
  lower = 0;
  other = 0;
  while (str[i])
    {
      if (str[i] >= 'a' && str[i] <= 'z')
	{
	  lower = lower + 1;
	  if (lower == my_strlen(str))
	    return (1);
	}
      else if (!(str[i] <= 'a' && str[i] >= 'z'))
	{
	  other = other + 1;
	  if (other != 0)
	    return (0);
	}
      i = i + 1;
    }
  return (2);
}
